|
Local variables
are declared within a function, and can only be used within that function.
This is usually no problem, since when another function is called, all
required data is passed to it as arguments. Alternatively, a veriable can be
declared so it is available to all functions. This is called a global
variable. Modern programming practice recommends against the excessive use of
global variables. They can lead to poor program structure, and tend to clog
up the available name space for variables.
|